﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ShSoft.Infrastructure.EntityBase;

namespace WarehouseSystem.Domain.Entities
{
    /// <summary>
    /// 出入库详细
    /// </summary>
    public class ICStockBillDetail : AggregateRootEntity
    {
        #region  # 构造器

        #region 01.无参构造器
        /// <summary>
        /// 无参构造器
        /// </summary>
        protected ICStockBillDetail()
        {
        }

        #endregion

        #region 02.创建出入库单据详细构造器
        /// <summary>
        /// 创建出入库单据详细
        /// </summary>
        /// <param name="quantity">数量</param>
        /// <param name="remark">备注</param>
        public ICStockBillDetail(decimal quantity, string remark)
            : this()
        {
            this.Quantity = quantity;
            this.Remark = remark;
            //初始化关键字
            this.InitKeywords();
        }

        #endregion

        #endregion

        #region # 属性

        #region 数量 —— decimal Quantity
        /// <summary>
        /// 数量
        /// </summary>
        public decimal Quantity { get; private set; }

        #endregion

        #region 备注 —— string Remark
        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; private set; }

        #endregion

        #region 导航属性 - 商品 —— Product Product
        /// <summary>
        /// 导航属性 - 商品
        /// </summary>
        public virtual Product Product { get; private set; }
        #endregion

        #region 导航属性 - 出入库单据 —— ICStockBill ICStockBill
        /// <summary>
        /// 导航属性 - 出入库单据
        /// </summary>
        public virtual ICStockBill ICStockBill { get; private set; }
        #endregion

        #endregion

        #region 方法

        //public

        #region 获取商品信息 ——



        #endregion

        //private

        #region 初始化关键字 —— void InitKeywords()
        /// <summary>
        /// 初始化关键字
        /// </summary>
        private void InitKeywords()
        {
            StringBuilder keywordsBuilder = new StringBuilder();
            keywordsBuilder.Append(base.Number);
            keywordsBuilder.Append(base.Name);

            base.SetKeywords(keywordsBuilder.ToString());
        }
        #endregion

        #endregion
    }
}
